<%--
  Created by IntelliJ IDEA.
  User: Ken
  Date: 2022/3/29
  Time: 15:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>管理员登录</title>
    <!-- 引入css样式 -->
    <link rel="stylesheet" href="css/login.css"/>
    <!-- 引入js文件 -->
    <script src="js/login.js"></script>
</head>
<body>
    <div class="title_div">
        <h1>学生管理系统-管理端</h1><br/>

        <c:if test="${param.status == '1'}">
            <span class="error">用户名或者密码错误</span>
        </c:if>
        <c:if test="${param.status == '2'}">
            <span class="error">验证码错误</span>
        </c:if>
        <c:if test="${param.status == '3'}">
            <span class="error">验证码过期</span>
        </c:if>

        <%--<%
            String status = request.getParameter("status");
            if ("1".equals(status)) {
        %>
            <span class="error">用户名或者密码错误</span>
        <%
            } else if ("2".equals(status)) {
        %>
            <span class="error">验证码错误</span>
        <%
            } else if ("3".equals(status)) {
        %>
            <span class="error">验证码过期</span>
        <%
            }
        %>--%>
    </div>

    <div class="core_div">
        <!--
         form表单的属性：
         method - 表示请求的类型 get/post
         action - 表示请求的服务器资源地址
         -->
        <form action="login" method="post">
            <table>
                <tr>
                    <td>用户名</td>
                    <td><input name="un" placeholder="请输入用户名"/></td>
                </tr>
                <tr>
                    <td>密码</td>
                    <td><input type="password" name="pw" placeholder="请输入密码"/></td>
                </tr>
                <tr>
                    <td>验证码</td>
                    <td>
                        <div class="code_div">
                            <input name="code" class="code"/> <img class="code_img" src="code" onclick="recode(this)"/>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: center">
                        <button type="submit">登录</button>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <button type="button" onclick="goRegister();">注册</button>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</body>
</html>
